// stores/user.js
import { defineStore } from 'pinia'


export const useUserStore = defineStore('user', {
    state: () => ({
        userInfo: {} ,
    }),
    actions: {
        setUser(user) {
            this.userInfo = user
        },
        getUser(){
            return this.userInfo
        }
    },
    persist: true // ✅ 开启持久化 不然页面刷新会掉
});